package com.glink.manage.dto.ai;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Collections;
import java.util.List;

@ApiModel(value = "AiTaskDTO对象", description = "Ai任务请求DTO")
@Data
public class AiTaskDTO {

    @ApiModelProperty(value = "任务分析id", example = "11111111")
    private String analyseId;

    @ApiModelProperty(value = "算法代码（目前支持4种，空列表[]。）", example = "[\"00003002\",\"00001002\",\"00001001\",\"00001011\"]")
    private List<String> algCode;

    @ApiModelProperty(value = "图片base64", example = "图片base64编码")
    private String imageData;

    // 手动定义algCode的setter方法
    public void setAlgCode(List<String> algCode) {
        if (algCode == null || algCode.isEmpty()) {
            this.algCode = Collections.emptyList(); // 或者设置为包含默认算法代码的列表
        } else {
            this.algCode = algCode;
        }
    }

    public AiTaskDTO() {
    }

    public AiTaskDTO(String analyseId, String imageData) {
        this.analyseId = analyseId;
        this.imageData = imageData;
    }
}
